Class JSSTrustManager
java.lang.Object
org.mozilla.jss.provider.javax.crypto.JSSTrustManager
- All Implemented Interfaces:
TrustManager,X509TrustManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTrustAnchors(Collection<X509Certificate> caCerts, CryptoToken token) private voidcertChainRevokeVerify(X509Certificate[] certChain, String KeyUsage, SSLCertificateApprovalCallback.ValidityStatus status) private intcertRevokeVerify(X509Certificate cert, int usage) voidcheckCertChain(X509Certificate[] certChain, String keyUsage) voidcheckCertChain(X509Certificate[] certChain, String keyUsage, SSLCertificateApprovalCallback.ValidityStatus status) voidcheckClientTrusted(X509Certificate[] certChain, String authType) voidcheckHostname(X509Certificate[] certChain, SSLCertificateApprovalCallback.ValidityStatus status) voidcheckIssuerTrusted(X509Certificate[] certChain, SSLCertificateApprovalCallback.ValidityStatus status) voidcheckKeyUsage(X509Certificate[] certChain, String keyUsage, SSLCertificateApprovalCallback.ValidityStatus status) voidcheckServerTrusted(X509Certificate[] certChain, String authType) voidcheckSignature(X509Certificate cert, X509Certificate[] caCerts, int depth, SSLCertificateApprovalCallback.ValidityStatus status) voidcheckValidityDates(X509Certificate[] certChain, SSLCertificateApprovalCallback.ValidityStatus status) voidconfigureAllowMissingExtendedKeyUsage(boolean allow) private X509Certificate[]private X509Certificate[]private Collection<CryptoToken> getTrustAnchorTokens(CryptoManager manager) private static booleanisCATrust(int trust) booleanprivate static booleanisInternalTokenName(String name) private static booleanisTrustAnchor(X509Certificate cert) booleanisTrustedPeer(X509Certificate[] certChain) booleanbooleanisValidSubject(CertificateSubjectName subject) voidsetCallback(SSLCertificateApprovalCallback certCallback) voidsetEnableCertRevokeVerify(boolean enableCertRevokeVerify) voidsetHostname(String hostname) voidsetTokenName(String tokenName)
-
Field Details
-
logger
public static final org.slf4j.Logger logger -
SERVER_AUTH_OID
- See Also:
-
CLIENT_AUTH_OID
- See Also:
-
INTERNAL_TOKEN_NAME
- See Also:
-
INTERNAL_TOKEN_FULL_NAME
- See Also:
-
hostname
-
tokenName
-
allowMissingExtendedKeyUsage
private boolean allowMissingExtendedKeyUsage -
enableCertRevokeVerify
private boolean enableCertRevokeVerify -
callback
-
-
Constructor Details
-
JSSTrustManager
public JSSTrustManager()
-
-
Method Details
-
isEnableCertRevokeVerify
public boolean isEnableCertRevokeVerify() -
setEnableCertRevokeVerify
public void setEnableCertRevokeVerify(boolean enableCertRevokeVerify) -
getHostname
-
setHostname
-
getTokenName
-
setTokenName
-
configureAllowMissingExtendedKeyUsage
public void configureAllowMissingExtendedKeyUsage(boolean allow) -
getCallback
-
setCallback
-
isValidSAN
- Throws:
Exception
-
isValidSubject
- Throws:
Exception
-
checkHostname
public void checkHostname(X509Certificate[] certChain, SSLCertificateApprovalCallback.ValidityStatus status) throws Exception - Throws:
Exception
-
checkCertChain
- Throws:
Exception
-
checkCertChain
public void checkCertChain(X509Certificate[] certChain, String keyUsage, SSLCertificateApprovalCallback.ValidityStatus status) throws Exception - Throws:
Exception
-
isTrustedPeer
- Throws:
Exception
-
checkIssuerTrusted
public void checkIssuerTrusted(X509Certificate[] certChain, SSLCertificateApprovalCallback.ValidityStatus status) throws Exception - Throws:
Exception
-
checkSignature
public void checkSignature(X509Certificate cert, X509Certificate[] caCerts, int depth, SSLCertificateApprovalCallback.ValidityStatus status) throws Exception - Throws:
Exception
-
checkValidityDates
public void checkValidityDates(X509Certificate[] certChain, SSLCertificateApprovalCallback.ValidityStatus status) throws Exception - Throws:
Exception
-
checkKeyUsage
public void checkKeyUsage(X509Certificate[] certChain, String keyUsage, SSLCertificateApprovalCallback.ValidityStatus status) throws Exception - Throws:
Exception
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] certChain, String authType) throws CertificateException - Specified by:
checkClientTrustedin interfaceX509TrustManager- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] certChain, String authType) throws CertificateException - Specified by:
checkServerTrustedin interfaceX509TrustManager- Throws:
CertificateException
-
getAcceptedIssuers
- Specified by:
getAcceptedIssuersin interfaceX509TrustManager
-
getAcceptedIssuersFromCACerts
-
getAcceptedIssuersFromToken
-
getTrustAnchorTokens
private Collection<CryptoToken> getTrustAnchorTokens(CryptoManager manager) throws NotInitializedException, NoSuchTokenException, TokenException -
isInternalTokenName
-
addTrustAnchors
private void addTrustAnchors(Collection<X509Certificate> caCerts, CryptoToken token) throws TokenException - Throws:
TokenException
-
isTrustAnchor
-
isCATrust
private static boolean isCATrust(int trust) -
certChainRevokeVerify
private void certChainRevokeVerify(X509Certificate[] certChain, String KeyUsage, SSLCertificateApprovalCallback.ValidityStatus status) -
certRevokeVerify
- Throws:
ObjectNotFoundException
-